<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="com.zust.java.bean.OrderDetail" %>
<%@ page import="java.util.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Processor订单细节</title>
</head>
<%
	List<Object> list = (List<Object>) request.getSession().getAttribute("orderDetail");
%>
<body>
<div>
<p><strong> 加工者订单详情 </strong></p>
	<table border="1">
		<tr>
			<th>名称</th>
			<th>数量</th>
			<th>完成情况</th>
			<th>完成个数</th>
			<th>操作</th>
		</tr>
		<%
			for (Object oList : list) {
			OrderDetail orderDetail = (OrderDetail) oList;
		%>

		<tr style="text-align: center">
			<td><%=orderDetail.getName()%></td>
			<td><%=orderDetail.getNumber()%></td>
			<td><%=orderDetail.getComplete()%></td>
			<%
				if (orderDetail.getCompleteDetail() != null) {
			%>
			<td><%=orderDetail.getCompleteDetail().getCompleteNum()%></td>
			<%
				} else {
			%>
			<td>0</td>
			<%
				}
			%>
			<td>
			    <!-- <button onclick="window.location.href='forwardToUpdatePage'">更新</button> -->
			    <button onclick="window.location.href='finishThisOne?orderDetailId=<%= orderDetail.getId() %>'">完成</button>
			</td>
		</tr>
		<%
			}
		%>
	</table>
	<%-- <a href="back?account1=<%= request.getSession().getAttribute("account1") %>&type=<%=request.getSession().getAttribute("type")%>">返回</a> --%>
	<!-- <button onclick="window.location.href='finishAll'">全部完成</button> -->
	<button onclick="window.history.back()">返回</button>
</div>
</body>
</html>